home *** CD-ROM | disk | FTP | other *** search
- real lower, upper;
-
- on ok
- {
- if (novalue(lim1+lim2)) ** novalue added to anything is novalue!!!
- {
- usererror("Please enter limits or click Cancel");
- abort;
- }
- }
-
- on checkdata
- {
- if (novalue(lim1+lim2))
- abort;
- }
-
- on initsim
- {
- lower = lim1;
- upper = lim2;
- if (lower > upper)
- {
- lower = upper;
- upper = lim1;
- }
- }
- on simulate
- {
- if (con1in > upper)
- con2out = upper;
- else if (con1in < lower)
- con2out = lower;
- else
- con2out = con1in;
-
- ** sysGlobal2 is the file reference number for the DEBUG TRACE
- if( sysGlobal2 != 0.0 ) ** 0 is error, check for open file for TRACE
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal2,"Clipper block number "+(MyBlockNumber())+". Current Time:"+currentTime+".","",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal2,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- fileWrite(sysGlobal2," Input = "+con1In,"",True);
- fileWrite(sysGlobal2," Output = "+con2Out,"",True);
- fileWrite(sysGlobal2," ","",True);
- }
- }
-
- on endSim
- {
- ** sysGlobal1 is the file reference number for the TEXT REPORT
- if( sysGlobal1 != 0.0 ) ** 0 is error, check for open file for REPORT
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal1,"Clipper block number "+(MyBlockNumber()),"",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal1,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- fileWrite(sysGlobal1," Upper Limit = "+upper,"",True);
- fileWrite(sysGlobal1," Lower Limit = "+lower,"",True);
- if( comments != "" )
- fileWrite(sysGlobal1," Comments = "+comments,"",True);
- fileWrite(sysGlobal1," ","",True);
- }
- }
-